@extends('admin.layout');

@section('title',$title);

@section('content');
    
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
文章管理
<small>添加</small>
</h1>
<ol class="breadcrumb">
<li><a href="#"><i class="fa fa-dashboard"></i> 主页</a></li>
<li><a href="#">文章管理</a></li>
<li class="active">添加</li>
</ol>
</section>

<!-- Main content -->
<section class="content">
<div class="row">
<!-- left column -->
<div class="col-md-12">
<!-- general form elements -->
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">快速添加文章</h3>
</div>

<form role="form" action="{{ url('/admin/article/update') }}/{{ $data -> id }}" method="post" enctype="multipart/form-data">
<div class="box-body">

<!-- 判断错误的  -->
@if(count($errors) > 0)
<div id='jg' class="callout callout-info">
<h4>警告！</h4>
@foreach ($errors->all() as $error)
<p>{{ $error }}</p>
@endforeach
</div>       
@endif


{{ csrf_field() }}
<div class="form-group">
<label  for="exampleInputEmail1">文章名</label>
<input name = 'title' type="text" class="form-control" value="{{ $data -> title }}"  id="exampleInputName"
placeholder="请输入6 - 18位的文章名">
</div>


<div class="form-group">
<label  for="exampleInputEmail1">作者</label>
<input name = 'author' type="text" class="form-control" value="{{ $data -> author }}"  id="exampleInputName"
placeholder="请输入6 - 18位的文章名">
</div>

    <script id="container" name="content" type="text/plain">
      {!! $data -> content !!}
    </script>
    <!--  <script style="width:100%;" id="container" name="content" type="text/plain"></script>
   配置文件 -->
    <script type="text/javascript" src="{{url('/ue/ueditor.config.js')}}"></script>
    <!-- 编辑器源码文件 -->
    <script type="text/javascript" src="{{url('/ue/ueditor.all.js')}}"></script>
    <!-- 实例化编辑器 -->
    <script type="text/javascript">
        var ue = UE.getEditor('container');
    </script>


<div class="box-footer"> 
<button type="submit" class="btn btn-primary">更新</button>
<button type="reset" class="btn btn-primary">重置</button>
</div>
</div>  
</form>
</div>
</div>
</div>  
</section>
</div>
<script type="text/javascript">
window.onload = function()
{
setInterval(function(){
$('#jg').fadeOut(1000);
},3000);
}

</script>  


@endsection